﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Space_Conquest
{
    class MapEditor : Map
    {

        #region Constructor
        
        public MapEditor(GameEngine parent, int length, int height) :
            base(parent, new int[height, length])
        {
            _editor = true;
            _currentTile = 1;
        } 
        
        #endregion

        #region Private Members

        int _currentTile;

        #endregion

        #region Methods

        public void TileClicked(int xTile, int yTile, System.Windows.Forms.MouseButtons button)
        {
            if (button == System.Windows.Forms.MouseButtons.Left)
            {
                _tiles[xTile, yTile].texTile = _textures[_currentTile];
                _tiles[xTile, yTile].ID = _currentTile;
            }
            else if (button == System.Windows.Forms.MouseButtons.Right)
            {
                if (_currentTile < _textures.Length-1 )
                    _currentTile++;
                else
                    _currentTile = 0;
            }

        }

        #endregion

    }
}
